﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using System.Configuration;
using Mukhopatro.BusinessLogicLayer;
using Mukhopatro.Helpers;
using Mukhopatro.BusinessEntities;
using System.Web.Routing;

namespace Mukhopatro
{
    public class Global : System.Web.HttpApplication
    {

        void Application_Start(object sender, EventArgs e)
        {
            // Code that runs on application startup
            RouteTable.Routes.Ignore(" ");
            RouteTable.Routes.Ignore("");
            RouteTable.Routes.Ignore("{resource}.axd/{*pathInfo}");
            RouteTable.Routes.Ignore("admin/{*pathInfo}");
            RouteTable.Routes.Ignore("boss/{*pathInfo}");
            RouteTable.Routes.Ignore("_services/{*pathInfo}");

            try
            {
                //CustomerContentBLL bll = new CustomerContentBLL();
                //List<CustomerContent> contents = bll.GetContents(obj => obj.ClientId.Equals(SiteSettings._CLIENT_ID) && obj.IsActive.Value && !obj.IsPrimaryContent.Value);

                //foreach (CustomerContent content in contents)
                //{
                //    RouteTable.Routes.Add("customer-content" + content.ContentId.ToString(), new Route("{content_url}", new PageRouteHandler("~/content-details.aspx")));
                //}

                
            }
            catch { }
        }

        void Application_End(object sender, EventArgs e)
        {
            //  Code that runs on application shutdown

        }

        void Application_Error(object sender, EventArgs e)
        {
            // Code that runs when an unhandled error occurs

        }

        void Session_Start(object sender, EventArgs e)
        {
            

        }

        void Session_End(object sender, EventArgs e)
        {
            // Code that runs when a session ends. 
            // Note: The Session_End event is raised only when the sessionstate mode
            // is set to InProc in the Web.config file. If session mode is set to StateServer 
            // or SQLServer, the event is not raised.

        }

    }
}
